package cn.sinata.wanglin.adapter;

import android.view.View;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.xilada.xldutils.adapter.HFRecyclerAdapter;
import com.xilada.xldutils.adapter.util.ViewHolder;

import java.util.List;

import cn.sinata.wanglin.R;
import cn.sinata.wanglin.model.SearchUser;
import cn.sinata.wanglin.utils.ImageUtil;

/**
 *
 * Created by liaoxiang on 16/12/29.
 */

public class SearchUserAdapter extends HFRecyclerAdapter<SearchUser> {

    public SearchUserAdapter(List<SearchUser> mData) {
        super(mData, R.layout.item_new_friend_layout);
    }

    @Override
    public void onBind(int position, final SearchUser searchUser, ViewHolder holder) {
        SimpleDraweeView headView = holder.bind(R.id.headView);
        headView.setImageURI(ImageUtil.parseImageUri(searchUser.getHeadUrl()));
        holder.setText(R.id.tv_name,searchUser.getNickName());
        holder.setText(R.id.tv_content,searchUser.getContent());
        TextView tv_action = holder.bind(R.id.tv_action);
        tv_action.setVisibility(View.GONE);
//        tv_action.setText(newFriend.getActionStr());
//        tv_action.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                if (TextUtils.equals("添加", newFriend.getActionStr())) {
//                    ActivityUtil.create(mContext)
//                            .go(AddFriendAuthMsgActivity.class)
//                            .put("id",newFriend.getId())
//                            .startForResult(16);
//                }
//            }
//        });
    }
}
